﻿Option Strict On
Imports System.Text
Imports Microsoft.Win32
Imports System.IO
''' <summary>
''' Class related to Sims 3 custom settings
''' </summary>
''' <remarks></remarks>
Public Class TS3CC
    ''' <summary>
    ''' Get the sims3 folder in my document
    ''' </summary>
    ''' <value>string</value>
    ''' <returns>string of path</returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property Sims3MyDocFolder As String
        Get
            Dim strPath As String = ""
            Dim Sims3Key As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Sims\The Sims 3", False)
            Dim strLocal As String = Sims3Key.GetValue("Locale").ToString
            strPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Electronic Arts", Locales.Item(strLocal))
            Return strPath
        End Get
    End Property
    ''' <summary>
    ''' Get the mod folder
    ''' </summary>
    ''' <value>stirng</value>
    ''' <returns>string of path</returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property ModFolder As String
        Get
            Dim strPath As String = Path.Combine(Sims3MyDocFolder, "Mods")
            Return strPath
        End Get
    End Property
    ''' <summary>
    ''' Get the DCCache folder
    ''' </summary>
    ''' <value>string</value>
    ''' <returns>string of path</returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property DCCacheFolder As String
        Get
            Dim strPath As String = Path.Combine(Sims3MyDocFolder, "DCCache")
            Return strPath
        End Get
    End Property
    ''' <summary>
    ''' Get the folder of Installed World Folder
    ''' </summary>
    ''' <value>string</value>
    ''' <returns>string of path</returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property InstalledWorldsFolder As String
        Get
            Dim strPath As String = Path.Combine(Sims3MyDocFolder, "InstalledWorlds")
            Return strPath
        End Get
    End Property

#Region "Local Name"
    Private Shared Locales As New Dictionary(Of String, String)() From { _
    {"en-US", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"zh-CN", Encoding.Unicode.GetString(New Byte() {&H21, &H6A, &HDF, &H62, &HBA, &H4E, _
        &H1F, &H75, &H33, &H0})}, _
    {"zh-TW", Encoding.Unicode.GetString(New Byte() {&H21, &H6A, &HEC, &H64, &H2, &H5E, _
        &H11, &H6C, &H33, &H0})}, _
    {"cs-CZ", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"da-DK", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"nl-NL", Encoding.Unicode.GetString(New Byte() {&H44, &H0, &H65, &H0, &H20, &H0, _
        &H53, &H0, &H69, &H0, &H6D, &H0, _
        &H73, &H0, &H20, &H0, &H33, &H0})}, _
    {"fi-FI", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"fr-FR", Encoding.Unicode.GetString(New Byte() {&H4C, &H0, &H65, &H0, &H73, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"de-DE", Encoding.Unicode.GetString(New Byte() {&H44, &H0, &H69, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"el-GR", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"hu-HU", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"it-IT", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"ja-JP", Encoding.Unicode.GetString(New Byte() {&HB6, &H30, &H65, &HFF, &HB7, &H30, _
        &HE0, &H30, &HBA, &H30, &H13, &HFF})}, _
    {"ko-KR", Encoding.Unicode.GetString(New Byte() {&HEC, &HC2, &H88, &HC9, &H20, &H0, _
        &H33, &H0})}, _
    {"no-NO", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"pl-PL", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"pt-PT", Encoding.Unicode.GetString(New Byte() {&H4F, &H0, &H73, &H0, &H20, &H0, _
        &H53, &H0, &H69, &H0, &H6D, &H0, _
        &H73, &H0, &H20, &H0, &H33, &H0})}, _
    {"pt-BR", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"ru-RU", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"es-ES", Encoding.Unicode.GetString(New Byte() {&H4C, &H0, &H6F, &H0, &H73, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"es-MX", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"sv-SE", Encoding.Unicode.GetString(New Byte() {&H54, &H0, &H68, &H0, &H65, &H0, _
        &H20, &H0, &H53, &H0, &H69, &H0, _
        &H6D, &H0, &H73, &H0, &H20, &H0, _
        &H33, &H0})}, _
    {"th-TH", Encoding.Unicode.GetString(New Byte() {&H40, &HE, &H14, &HE, &H2D, &HE, _
        &H30, &HE, &HB, &HE, &H34, &HE, _
        &H21, &HE, &H2A, &HE, &H4C, &HE, _
        &H20, &H0, &H33, &H0})} _
}
#End Region
    ''' <summary>
    ''' The langauge setting of the user
    ''' </summary>
    ''' <value>string</value>
    ''' <returns>the culture name</returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property CultureName As String
        Get
            Dim strPath As String = ""
            Dim Sims3Key As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Sims\The Sims 3", False)
            Dim strLocal As String = Sims3Key.GetValue("Locale").ToString
            Return strLocal
        End Get
    End Property
End Class
